   
    Conway's Game of Life

  http://www.radicaleye.com/lifepage/
  http://www.math.com/students/wonders/life/life.html

Implemented on Cosmac Elf by Josh Bensadon,  Sept 2003

This is a simulation game,  the entire screen is a 2 dimensional
world for these cells.  Each cell has 8 neighbors (above, below,
right, left, and 4 diagonal corners).  If a cell is alive and
has exactly 2 or 3 neighbors, it remains alive.  If less than 2,
it dies of loniness, more than 3 it's over crowded.  If a cell
is not alive, and there are exactly 3 neighbors, it will come
alive in the next cycle.

Load the game (life3.cos or life3.hex) at 0x0000,  it uses 3 pages.
It requires pages 6 and 7 for video (it fills the alternate page).
Hence, program requires 2K of ram.

Turn Data switch 7 ON  (Input mode)

Turn Run switch ON

Input Mode:
   Switch 6 does a Clear Screen.
   Switch 0 moves cursor right
   Switch 1  "      "    left
   Switch 2  "      "    down
   Switch 3  "      "    up
   Input Switch toggles the pixel (cell).  Holding this switch down
   will set/reset many cells if the cursor is moving in any direction.

   Set your pattern, or use the random pattern that was in the undefined
   RAM space.

   Turn Switch 7 OFF  (Run Mode)

Run Mode:
Hex display shows the current generation (00-FF, then loops)
Sit back and watch the game of life!

Turn Switch 7 ON at any time to return to Input Mode


Enjoy!
Josh


PS.  There are two versions here,  Life.??? and Life2.???
The first version runs 19 cycles per minute.
The 2nd version runs 52 cycles per minute.  It is
optimized for speed, and I would like to hear any suggestions
to make it go faster!
Version 3 using more inline code, I'm up to 57 cpm!

Version 1, goes bit by bit, counting it's neighbors.
Version 2, does a whole byte at a time, using 8 registers to
count the neighbors within that byte.
Version 3, removed a subroutine call (thought I might have
needed to save space, but I was wrong). Put all code inline.
and removed some unnecessary code.